


#  131.分割回文串

def main(str):
    result = []
    temp = []

    def judge(nums,start,end):
        i = start
        j = end
        while i<j:
            if nums[i] != nums[j]:
                return False
            j = j - 1
            i = i + 1
        return True


    def backtrack(str,startIndex):
        if startIndex == len(str):
            result.append(temp[:])
            return
        for i in range(startIndex,len(str)):
            if judge(str,startIndex,i):
                temp.append(str[startIndex:i+1])
                backtrack(str,i+1)
                temp.pop()

    backtrack(str,0)
    return result

if __name__ == "__main__":
    str = input()
    result = main(str)
    print(result)